<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:mias="http://www.monsters.inc/mias">
<!-- 
     Everything outside the ui:composition tag will be ignored by Facelets!
-->
<ui:composition>
  <!--
       The required attribute is optional, if it is omitted, we assume "not
       required" 
  -->
  <c:if test="#{empty required}">
    <c:set var="required" value="false" />
  </c:if>
  <c:if test="#{empty accept}">
    <c:set var="accept" value="*/*" />
  </c:if>
  
  <!--
       This component is designed to be used within a panelGrid with 4 columns.
       For each column a component will be rendered:
           - column 1: a label. The "id" parameter will be used to lookup a 
                       label text in the message bundle.
           - column 2: the input field. The field will be bound to the bean 
                       that is set with the "bean" parameter. The "id" 
                       parameter will be used to identify the member variable
                       within the bean.
           - column 3: a "required" indicator. If "required" is set to true, a
                       * will be rendered. In all other cases a space will be
                       rendered.
           - column 4: a message component for validation errors
        The "minLength" and "maxLength" parameters can be used to set the 
        minimum and maximum length of the user input. An appropriate length 
        validator will be added to the input component.
        If the "secret" parameter evaluates to "true", a password field will 
        be used instead of a normal input field. 
  -->

  <h:outputLabel for="#{id}" value="#{msg[id]}:" />
  <t:inputFileUpload id="#{id}" value="#{bean[id]}" />
  <h:outputText value="#{required ? '*' : ' '}"/>
  <h:message for="#{id}"/>

</ui:composition>
</html>
